<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css" />
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css" />
		
	</head>

	<body>
		<div class="am-g">
			{include file='../Common/hy_header.html'}
			<style>
				.yf-form {
					float: left !important;
				}
			</style>
			<div class="am-u-md-8 am-u-end">
				<form class="am-form am-form-horizontal hy-js-form">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">字段</label>
						<div class="am-u-sm-6 yf-form">
							<select name="fields_id" {if $info.fields_id neq ''} disabled {/if}>
								<option value="0">请选择字段</option>
								{foreach from=$field item=fd}
								<option value="{$fd.id}" {if $info.fields_id eq $fd.id} selected {/if}>{$fd.name}----{$fd.data}----{$fd.type}</option>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">字段类型</label>
						<div class="am-u-sm-6 yf-form">
							<select name="type" id="type_change">
								<option value="0">请选择字段类型</option>
								<option value="int" {if $info.type eq 'int'} selected {/if}>数值---int</option>
								<option value="varchar" {if $info.type eq 'varchar'} selected {/if}>小文本---varchar</option>
								<option value="text" {if $info.type eq 'text'} selected {/if}>大文本---text</option>
							</select>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">字段大小</label>
						<div class="am-u-sm-6 yf-form">
							<input type="text" name="type_size" id="type_size" value="{$info.type_size}" placeholder="请先选择字段类型">
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-intro" class="am-u-sm-3 am-form-label">是否必填</label>
						<div class="am-u-sm-6 yf-form">
							<div class="am-btn-group" data-am-button="">
								<label class="am-btn am-btn-default am-btn-xs {if $info.status eq '' || $info.status eq 0}am-active{/if}">
									<input type="radio" name="status" value="0" {if $info.status eq '' || $info.status eq 0}checked="checked"{/if} id="option1"> 否
								</label>
								<label class="am-btn am-btn-default am-btn-xs {if $info.status eq 1}am-active{/if}">
									<input type="radio" name="status" value="1" {if $info.status eq 1}checked="checked"{/if} id="option2"> 是
								</label>
							</div>
						</div>
					</div>
					<div class="am-form-group">
						<label for="user-intro" class="am-u-sm-3 am-form-label">显示列表</label>
						<div class="am-u-sm-6 yf-form">
							<div class="am-btn-group" data-am-button="">
								<label class="am-btn am-btn-default am-btn-xs {if $info.is_list eq '' || $info.is_list eq 0}am-active{/if}">
									<input type="radio" name="is_list" value="0" {if $info.is_list eq '' || $info.is_list eq 0}checked="checked"{/if} id="op1"> 否
								</label>
								<label class="am-btn am-btn-default am-btn-xs {if $info.is_list eq 1}am-active{/if}">
									<input type="radio" name="is_list" value="1" {if $info.is_list eq 1}checked="checked"{/if} id="op2"> 是
								</label>
							</div>
						</div>
					</div>
					<div class="am-form-group">
						<input type="hidden" name="form_id" value="{$form_id}">
						<input type="hidden" name="id" value="{$id}">
						<div class="am-u-sm-6 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-primary hy-js-submit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		{include file='../Common/hy_footer.html'}
		<script type="text/javascript">
			$(function(){
				$('#type_change').change(function(){
					var type = $(this).val();
					if(type == 0)
					{
						$('#type_size').val('');
					}
					if(type == 'int')
					{
						$('#type_size').val(11);
					}
					if(type == 'varchar')
					{
						$('#type_size').val(255);
					}
					if(type == 'text')
					{
						$('#type_size').val(0);
					}
				});
			});
			hy_submit('index.php?g=admin&m=forms&a={$action}');
		</script>
	</body>

</html>